﻿using ERP.Model.Base;
using System.Collections.Generic;

namespace ERP.DAL.Base
{
    public class DalT_BASE_ACCOUNT : DalBase
    {
        public static IList<T_BASE_ACCOUNT> GetIList(string SelectName, T_BASE_ACCOUNT model)
        {
            string sql = GetRuntimeSql(SelectName, model);
            return objMapper.GetMapper().QueryForList<T_BASE_ACCOUNT>(SelectName, model);
        }

        public static int GetIListCount(T_BASE_ACCOUNT model)
        {
            return int.Parse(objMapper.GetMapper().QueryForObject("T_BASE_ACCOUNT.SelectT_BASE_ACCOUNT_COUNT", model).ToString());
        }

        public static void DeleteData(int id)
        {
            objMapper.GetMapper().Delete("T_BASE_ACCOUNT.DeleteT_BASE_ACCOUNT", id);
        }

        public static int InsertData(T_BASE_ACCOUNT model)
        {
            return int.Parse(objMapper.GetMapper().Insert(model.InsertName, model).ToString());
        }

        public static void UpdateData(T_BASE_ACCOUNT model)
        {
            objMapper.GetMapper().Update(model.UpdateName, model);
        }
    }
}